package com.platform.admin.contant;

import lombok.NoArgsConstructor;

/**
 * <p>
 *
 * </p>
 *
 * @author： yuanlai
 * @since 2021-06-23
 */
@NoArgsConstructor
public final class RuleConstant {
    public static final int FLOW_GRADE_THREAD = 0; //限流 基于线程数
    public static final int FLOW_GRADE_QPS = 1; //限流 基于QPS

    public static final int DEGRADE_GRADE_RT = 0; //降级  ， 代表一秒内该资源的平均响应时间
    /**
     * Degrade by biz exception ratio in the current {@link IntervalProperty#INTERVAL} second(s).
     */
    public static final int DEGRADE_GRADE_EXCEPTION_RATIO = 1; // 降级 异常比例
    /**
     * Degrade by biz exception count in the last 60 seconds.
     */
    public static final int DEGRADE_GRADE_EXCEPTION_COUNT = 2;// 降级， 异常数

    public static final int AUTHORITY_WHITE = 0;// 认证， 白名单
    public static final int AUTHORITY_BLACK = 1;// 认证， 黑名单

    public static final int STRATEGY_DIRECT = 0; //
    public static final int STRATEGY_RELATE = 1;
    public static final int STRATEGY_CHAIN = 2;

    public static final int CONTROL_BEHAVIOR_DEFAULT = 0;// 限流行为，直接拒绝
    public static final int CONTROL_BEHAVIOR_WARM_UP = 1;// 限流行为，WARM_UP
    public static final int CONTROL_BEHAVIOR_RATE_LIMITER = 2;// 限流行为，匀速排队
    public static final int CONTROL_BEHAVIOR_WARM_UP_RATE_LIMITER = 3;

    public static final String LIMIT_APP_DEFAULT = "default";
    public static final String LIMIT_APP_OTHER = "other";

    public static final int DEFAULT_SAMPLE_COUNT = 2;
    public static final int DEFAULT_WINDOW_INTERVAL_MS = 1000;
}
